<%= tr8n_lightbox_header_tag %>
<div class="inner">
    <div class="hd">
      <%= tr8n_lightbox_title_tag(tra("Merging Translation Keys")) %>
    </div>
    <div class="bd" style="padding-bottom:60px;">
      <%= form_for(@key, :as => :translation_key, :url => {:action => :merge}, :html => {:id => 'tr8n_form', :method => :post, :class => "tr8n"}) do |form| %>
        <%= form.hidden_field :id %>
        <%= hidden_field_tag :keys, @keys.collect{|key| key.id}.join(',') %>
        <%= hidden_field_tag(:origin, params[:origin]) %>
        
      	<div style="background-color:#f1f4fa; padding:5px; max-height:120px; overflow:auto; margin-bottom: 10px; border: 1px solid #ccc;">
      		<table style="width:100%">
      			<% @keys.each_with_index do |key, index| %> 
      			<tr style="<%= "border-bottom:1px solid #ccc;" unless index == @keys.count-1 %>">
              <td style="padding:5px;width:20px;">
                <%= index+1 %>)
              </td>
      				<td style="cursor:pointer; padding:5px;" onClick="Tr8n.element('master_key_label').value=Tr8n.element('key_label_<%=index%>').innerHTML;Tr8n.element('master_key_description').value=Tr8n.element('key_description_<%=index%>').innerHTML;">
      					<div id="key_label_<%=index%>"><%=key.label%></div>
      					<div id="key_description_<%=index%>" style="color:#888; font-size:9px;"><%=key.description%></div>
      				</td>
      				<td style="text-align:right;padding:5px;"><%=key.translations.count%></td>
      			</tr>
      			<% end %>
      		</table>
      	</div>
      	
        <table class="admin_table">
            <tr>
                <th>
                    Label:
                </th>
                <td>
                    <%= form.text_field :label, :style=>"width:99%;", :id => :master_key_label %>
                </td>
            </tr>
            <tr>
                <th>
                    Description:
                </th>
                <td>
                    <%= form.text_field :description, :style=>"width:99%;", :id => :master_key_description %>
                </td>
            </tr>
        </table>
        
        <div><em>Note: merging translation keys will join all of the translations for each language and unlock the merged key.</em></div>

      <% end %>
    </div>
    <div class="ft">
      <%= tr8n_lightbox_buttons_tag %>
    </div>
</div>
<%= tr8n_lightbox_footer_tag %>
